#include "process_bar.h"
#include<unistd.h>

typedef void(*callback)(int);
void downLoad(callback cb)
{
    int total=1000;
    int cur=0;
    while(cur<=total)
    {
        usleep(50000);
        int rate=cur*100/total;

        cb(rate);
        cur+=10;
    }
    printf("\n");
}


int main()
{
    printf("download 1:\n");
    downLoad(processbar);
    initbar();
    return 0;
}